﻿<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="true" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=1600, initial-scale=1.0">
    <title>答卷内容</title>
    <link rel="stylesheet" href="css/link.css">
    <link rel="shortcut icon" href="images/favicon.ico">
</head>

<body>
    <div class="nav">
        <a href="#"><img src="images/logo.png" width="130" height="48"></a>
    </div>
    <div class="questions">
        <form action="#" method="post">
            <c:forEach items="${questionList}" var="question" varStatus="loop">
                <c:choose>
                    <c:when test="${question.type eq 1 }">
                        <div class="question">
                            <p>${question.orderNumber}.单选题:${question.description}</p>
                            <p>选项A:${question.choiceA}</p>
                            <p>选项B:${question.choiceB}</p>
                            <p>选项C:${question.choiceC}</p>
                            <p>选项D:${question.choiceD}</p>
                            <p>用户选项为:
                                <c:if test="${ answers[loop.count-1].answerA eq true }">A</c:if>
                                <c:if test="${ answers[loop.count-1].answerB eq true }">B</c:if>
                                <c:if test="${ answers[loop.count-1].answerC eq true }">C</c:if>
                                <c:if test="${ answers[loop.count-1].answerD eq true }">D</c:if>
                            </p>
                        </div>
                    </c:when>
                    <c:when test="${question.type eq 2 }">
                        <div class="question">
                            <p>${question.orderNumber}.多选题:${question.description}</p>
                            <p>选项A:${question.choiceA}</p>
                            <p>选项B:${question.choiceB}</p>
                            <p>选项C:${question.choiceC}</p>
                            <p>选项D:${question.choiceD}</p>
                            <p>用户选项为:
                                <c:if test="${ answers[loop.count-1].answerA eq true }">A</c:if>
                                <c:if test="${ answers[loop.count-1].answerB eq true }">B</c:if>
                                <c:if test="${ answers[loop.count-1].answerC eq true }">C</c:if>
                                <c:if test="${ answers[loop.count-1].answerD eq true }">D</c:if>
                            </p>
                        </div>
                    </c:when>
                    <c:otherwise>
                        <div class="question">
                            <p>${question.orderNumber}.问答题:${question.description}</p>
                            <p>${answers[loop.count-1].answerA}</p>
                        </div>
                    </c:otherwise>
                </c:choose>
            </c:forEach>
        </form>
    </div>
</body>

</html>